<?php
/**
 * Created by PhpStorm.
 * Created at 21/05/2018 10:54.
 */

require_once __DIR__ . '/../vendor/autoload.php';

$container = new \Illuminate\Container\Container();

$container->when(\App\Bar\GoodBar::class)
    ->needs(\App\Contracts\FooInterface::class)
    ->give(\App\Foo\GoodFoo::class);

$container->when(\App\Bar\BadBar::class)
    ->needs(\App\Contracts\FooInterface::class)
    ->give(\App\Foo\BadFoo::class);

$container->tag([\App\Bar\GoodBar::class, \App\Bar\BadBar::class], 'bars');

// dump($container);

// 获取属于 `bars` 标签的所有绑定
dump($container->tagged('bars'));
